package br.com.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;

import br.com.bean.ResponsavelBean;

public class ResponsavelDAO {
	public void inserir(Connection conn, ResponsavelBean value) throws Exception {
		String sql = "INSERT INTO responsavel(id, nome, nascimento, funcao, cliente) VALUES (?, ?, ?, ?, ?)";
		
		PreparedStatement ps = conn.prepareStatement(sql);
		ps.setInt(1, value.getId());
		ps.setString(2, value.getNome());
		ps.setDate(3, value.getNascimento());
		ps.setString(4, value.getFuncao());
		ps.setInt(5, value.getEmpresa().getId());
		ps.execute();
		ps.close();

	}

}
